package com.factory_project;

public class Car extends MotorVehicle{
    private String type;
    public Car(String vehicleId,String brand, String type, float perRent) {
        super(vehicleId, brand, perRent);
        this.type = type;
    }
    @Override
    public double calRent(int days) {
        if(days<=7){
            return days* getPerRent();
        }else if(days>7&&days<=30){
            return  days*getPerRent()*0.9;
        }else if(days>30&&days<=150){
            return days*getPerRent()*0.8;
        }else{
            return days*getPerRent()*0.7;
        }
    }
}
